<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div>saaas</div>
  <script>
    /* boolean在对象里面为真 */
    /* const boolean = new Boolean(true)
    console.log(typeof boolean); // object
    console.log(boolean.valueOf()); // true,
    if (boolean.valueOf()) {
      console.log("wangyanng");
    } */


    /* 
        let wangyang = true;
        console.log(typeof wangyang); // boolean
        if (wangyang) {
          console.log("wangyang");
        }
         */
    /* 
        let number = 99
        if (number) console.log('number');
       */

    /*    
    let number = 0;
    console.log(number == false); // true   就是相当于false在转换的时候，是0，
 */
    /* 
        let number = 89;
        console.log(number == false); // false */

    /* 
        let number = 1;
        console.log(number == true); // true ,这里true就是转换为1了
         */
    /* 
        // 当一个数组的时候，里面的转换类型是1
        let array = [1];
        console.log(Number(array)); // 1
        console.log(array == true); // true
         */

    /*         
       // 当时空数组的时候，里面 就是0
      let array = [];
      console.log(Number(array)); // 0
      console.log(array == false); // true
    */

    // console.log(Boolean([])); // true
  </script>
</body>

</html>